package br.com.array.android.ma.view.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import br.com.array.android.ma.R;

/**
 * Created by leonardo.neves on 09/05/2014.
 *
 */
public class LoginActivity extends Activity {

    private EditText usuario;
    private EditText senha;
    private Button novo;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);

        usuario = (EditText) findViewById(R.id.value_usuario);
        senha = (EditText) findViewById(R.id.value_senha);
        novo = (Button) findViewById(R.id.bt_acesso);

        usuario.setText("array");
        senha.setText("array");

        novo.setOnClickListener(onNovo());

    }

    private View.OnClickListener onNovo() {
        return new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(LoginActivity.this, TelaPrincipalActivity.class));
            }
        };
    }

    private View.OnClickListener onCancelar(){
        return new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        };
    }
}